<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>

<s:include value="../header.jsp"></s:include>
<s:include value="../leftNav.jsp"></s:include>

<div id="content">

<div id="tabs">
	<ul>
		<li><s:a href="#tabs-1" action="testActionJsp.action">Edit meeting</s:a></li>
		<li><s:a href="#tabs-2" action="testActionJsp.action">Edit address</s:a></li>
		<li><s:a href="#tabs-3" action="testActionJsp.action">Edit participants</s:a></li>
	</ul>
	<div id="tabs-1">
 		<p>Edit Meeting</p>
		<s:form name="addForm" method="post" action="editMeetingForm.action" theme="xhtml">
			<s:textfield name="title" label="Title" size="60"/>
			<s:textarea label="Description" name="description" cols="60" rows="6"/>
			<sx:datetimepicker name="meetingDate" label="Date" 
				displayFormat="dd-MMM-yyyy" value="todayDate" />
			<s:textfield name="meetingTime" label="Time" size="10"/>
			<s:textfield name="place" label="Place" size="60"/>
			<s:radio label="Leading" name="leadingChoose" list="#{'1':'Set me as a leading user','2':'Choose user'}" value="2" />
			<sx:autocompleter label="Leading user nickname" list="users" name="leadingNickname" size="30"/>
			<s:submit type="button" name="Add" label="Create meeting" />
		</s:form>
	</div>
	<div id="tabs-2">
 		<h3>Edit meeting address details:</h3>
		<s:form name="addForm" method="post" action="editMeetingAddress.action" theme="xhtml">
			<s:textfield name="city" label="City" />
			<s:textfield name="address1" label="Address" />
		 	<s:textfield name="state" label="State" />
		 	<s:textfield name="zipcode" label="Zipcode" />
		 	<s:select label="Country" headerKey="-1"
				headerValue="select country" list="countries" name="country" />
			<s:submit type="button" name="Add" label="Create meeting"/>
		</s:form>
	</div>
	<div id="tabs-3">
 		<h3>Edit meeting participants</h3>
		<s:form name="addForm" method="post" action="editMeetingParticipants.action" theme="xhtml">
			<sx:autocompleter label="Add user" list="users" name="participant" size="30"/>
			<s:submit type="button" name="Add" label="Create meeting"/>
		</s:form>
		
		<s:if test="participants.size > 0">
			<p>Users already added:</p>
			<table id="participants">
				<tr>
						<td><p>Username:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p></td>
						<td><p>User email:</p></td>
				</tr>
				<s:iterator value="participants">
					<tr>
						<td><p><s:property value="username" /></p></td>
						<td><p><s:property value="email" /></p></td>
						<td><s:url id="deleteUser" value="removeParticipants.action">
								<s:param name="userId" value="userId" />
							</s:url> <s:a href="%{deleteUser}">Remove</s:a>
						</td>
					</tr>
				</s:iterator>
			</table>
		</s:if>
	</div>
</div>
</div>
</body>
</html>